package com.ws.overwrite;

public class Student extends Person{

    String major;

    public Student() {

    }

    public Student(String major) {
        this.major = major;
    }

    public void eat() {
        System.out.println("学生恰饭");
    }

    public void study() {
        System.out.println("学习。专业是：" + major);
    }

//    public double info() {
//        return 2;
//    }

    @Override
    public void walk(int distance) {
        System.out.println("重写的方法");
    }
}
